# memoryRepository.coffee
cache = require('cache')
class MemoryRepository

  set: (id, value, callback)->
    cache.put id, value
    callback()

  get: (id, callback) ->
    value = cache.get id
    callback(null, value)

  remove: (id, callback) ->
    cache.del id
    callback()

  contains: (id, callback) ->
    value = cache.get id
    callback(null, true)

root = exports ? window
root.MemoryRepository = MemoryRepository